package sample_schedular;

import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import java.util.Properties;
import java.util.Random;

public class NegativeRandomSampler implements Sampler {

	@Override
	public void initialize(Properties properties) {
	}

	@Override
	public List<Integer> resample(List<Integer> list, int n) {
		List<Integer> negative = new LinkedList<Integer>();
		
		int counter = 0;
		for(int label : list) {
			if(label == 0) {
				negative.add(counter);
			}
			counter++;
		}
		
		Collections.shuffle(negative, new Random(0));
		List<Integer> result = negative.subList(0, n);
		return result;
	}

}
